import { IGaeaSetting } from '../../defines/application';
import { Properties, CommonProps } from '../common/CommonProps';

export class Props extends CommonProps {
  public editSetting: IGaeaSetting = {
    key: 'gaea-imagepicker',
    name: 'ImagePicker',
    type: 'text',
    grouping: 'otherType',
    editors: [
      ...Properties,
      {
        field: 'multiple',
        type: 'radio',
        text: 'Options',
        data: [
          { text: 'OneImage', value: false },
          { text: 'MultiImage', value: true }
        ]
      }
    ]
  };

  //   public disabled:boolean = false;// ==> selectable
  // public length: number = 3; // 最多可以传几张
  public multiple = false; // 是否多选
  public readonly = false; // 只读模式
  public disabledDelete = false;
  // public action: string = ''; // 上传的url
  public data: IFile[] = [];
  public placeholder = '';
  public renderMode?: FormRenderModes;
  public formValues: IterateAny;
  // {
  //   uid: '-1',// pc中must要有这个
  //   // name: 'image.png',
  //   status: 'done',
  //   url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
  // },
}

export class State {
  previewVisible?: boolean;
  previewImage?: string;
  previewIndex?: number;
  files: any;
}

export interface IFile {
  url: string;
  uid?: string;
  name?: string;
  status: string;
  id?: string;
  orientation?: string;
}
